from django.db import models

# Create your models here.

class UserType(models.Model):

    name = models.CharField(max_length=50)

class UserInfo(models.Model):

    username = models.CharField(max_length=50)

    password = models.CharField(max_length=50)

    Gender = models.BooleanField(default = False)

    Age = models.IntegerField(default = 19)

    memo = models.TextField(default = 'xxxx')

    CreateDate = models.DateTimeField(default = '2011-12-12 12:12')

    typeId = models.ForeignKey('UserType')


class Group(models.Model):

    Name = models.CharField(max_length=50)

class User(models.Model):

    Name = models.CharField(max_length=50)

    Email = models.CharField(max_length=50)

    group_relation = models.ManyToManyField('Group')


class ASrgs(models.Model):

    name = models.CharField(max_length=20, null=True)

    not_name = models.CharField(max_length=20, null = False)


class Asset(models.Model):

    hostname = models.CharField(max_length=256)

    creat_date = models.DateField(auto_now_add=True)

    update_date = models.DateField(auto_now=True)


class UserInfo_Temp(models.Model):

    GENDER_CHOICE = (
        (u'1',u'普通用户'),
        (u'2',u'管理员'),
        (u'3',u'超级管理员'),
    )

    UserType = models.CharField(max_length=2,choices=GENDER_CHOICE)


















